<?$this->load->library('form_validation');?>
<div class="container">
	<div class="module mod-line-top">
	<?=validation_errors('<div class="alert alert-danger">', '</div>'); ?>
	<?php
	if(isset($message) && $message){
		echo '<div class="alert alert-success">'.$message.'</div>';
	}
	?>
	<form id="question-form" name="question-form" action="<?=site_url('admin/question/edit/'.$question['id'])?>" method="post">
		<h2>Edit Question</h2>
		
		<div class="row">
			<div class="form-group col-md-6">
				<label>Title</label>
				<input class="form-control" maxlength="100" name="q_title" type="text" value="<?=set_value('q_title', $question['title'])?>">	
			</div>
		</div>
		
		<div class="row">
			<div class="form-group col-md-6">
				<label>Section</label>
				<select class="form-control" id="section" name="q_section">
		    		<option></option>
					<option value='Section1' <?=set_select('q_section', 'Section1', $question['section'] == 'Section1')?>>Section1</option>
					<option value='Section2' <?=set_select('q_section', 'Section2', $question['section'] == 'Section2')?>>Section2</option>
					<option value='Section3' <?=set_select('q_section', 'Section3', $question['section'] == 'Section3')?>>Section3</option>
					<option value='Section4' <?=set_select('q_section', 'Section4', $question['section'] == 'Section4')?>>Section4</option>
		    	</select>
			</div>
		</div>
		<div class="row">
			<div class="form-group col-md-12">
				<label for="sg_money">Question/Answers</label>
				<span class="help-block">把文字选中，改成<strong>粗体</strong>表示答案</span>
				<textarea name='q_content' style='width: 100%; height: 400px;' id="q_content"><?=set_value('q_content', $question['question'])?></textarea>
			</div>
		</div>
		<div class="form-actions">
			<button type="submit" class="btn btn-primary">Submit</button>
	  		<button type="reset" class="btn btn-default">Reset</button>
		</div>
	</form>
	</div>
</div>

<script type="text/javascript" src="/external/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
				mode : "textareas",
				plugins : "table",
				table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
		        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,bullist,numlist,|,image,|,forecolor,|,code",
				theme_advanced_buttons2 : "formatselect,fontsizeselect,|,tablecontrols",
				theme_advanced_buttons3 : ""
				
			});
</script>


